package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.SystemType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by oyhk on 2017/3/9.
 *
 * 用户表 扩展系统权限
 *
 * 如果是mallId 有值，那么就是对应用户M端权限
 */
@Entity
@Table(name = "auth_title_resource")
@DynamicInsert
@DynamicUpdate
public class AuthTitleResource extends IDEntityMall {

    @Column(columnDefinition = "bigint comment '用户id'")
    private Long titleId;
    @Column(columnDefinition = "bigint comment '拥有者ID'")
    private Long ownerId;
    @Column(columnDefinition = "bigint comment '菜单资源id'")
    private Long resourceId;
    @Column(columnDefinition = "bigint comment '菜单资源父id'")
    private Long resourceParentId;
    @Column(columnDefinition = "varchar(50) comment '系统类型 ADMIN(\"R端\"),MALL(\"M端\"),MERCHANT(\"B端\")'")
    @Enumerated(EnumType.STRING)
    private SystemType systemType;

    public Long getResourceParentId() {
        return resourceParentId;
    }

    public void setResourceParentId(Long resourceParentId) {
        this.resourceParentId = resourceParentId;
    }

    public Long getOwnerId() {
        return ownerId;
    }

    public void setOwnerId(Long ownerId) {
        this.ownerId = ownerId;
    }

    public Long getTitleId() {
        return titleId;
    }

    public void setTitleId(Long titleId) {
        this.titleId = titleId;
    }

    public Long getResourceId() {
        return resourceId;
    }

    public void setResourceId(Long resourceId) {
        this.resourceId = resourceId;
    }

    public SystemType getSystemType() {
        return systemType;
    }

    public void setSystemType(SystemType systemType) {
        this.systemType = systemType;
    }
}
